package com.fgs.common.uploadPicture.compress;

import android.graphics.Bitmap;

import com.fgs.common.uploadPicture.compress.luban.LuBanPictureCompress;

import java.io.File;

/**
 * @author fgs
 * @date 2020/10/17
 * @description
 **/
public class CompressController {
    private IPictureCompress iPictureCompress;

    private CompressController() {
        iPictureCompress = new LuBanPictureCompress();
    }

    public static CompressController getInstance() {
        return SingleHolder.instance;
    }

    private static class SingleHolder {
        private static final CompressController instance = new CompressController();
    }

    public void pictureCompress(File file, OnPictureCompressListener compressListener) {
        iPictureCompress.pictureCompress(file, compressListener);
    }

    public void pictureCompress(Bitmap bitmap, OnPictureCompressListener compressListener) {
        iPictureCompress.pictureCompress(bitmap, compressListener);
    }
}
